<template>
	<a-config-provider :locale="locale">
		<router-view />
	</a-config-provider>
</template>

<script setup lang='ts'>
import cache from '@/utils/cache';
import zh_CN from 'ant-design-vue/es/locale/zh_CN';
import en_US from 'ant-design-vue/es/locale/en_US';
import type { Locale } from 'ant-design-vue/lib/locale-provider';
import { mainStore, setContainerHeight } from './store/main';

const locale: Locale = cache.getLocale() === 'zh-cn' ? zh_CN : en_US;
window.onresize = () => {
	setContainerHeight();
	return mainStore().containerHeight;
}
</script>